﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace tactics.Abilities
{
    public class EffectAbility : BaseAbilityComponent
    {
        int effectId;

        public EffectAbility()
        {
        }

        public EffectAbility(int effectIdIn)
        {
            effectId = effectIdIn;
        }
        
        public override void SetProperty(string property, string value)
        {
            switch (property)
            {
                case "effectId":
                    effectId = int.Parse(value);
                    break;
            }
        }

        public override void UseAbility(Unit unit)
        {
            base.UseAbility(unit);

            unit.AddEffect(TacticsEngine.Instance.Game.StatusEffectLoader.GetEffectById(effectId).Clone());
        }
    }
}
